package com.sxt.b_work;

import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: 雷哥
 * @Date: 2020/10/07/21:25
 * @Description:
 */
@Component
public class DirectCustomer {
  @RabbitListener(bindings ={
      @QueueBinding(
          value = @Queue(),
          key={"info","error"},
          exchange = @Exchange(type = "direct",name="directs")
      )})
  public void receive1(String message){
    System.out.println("message1 = " + message);
  }
  @RabbitListener(bindings ={
      @QueueBinding(
          value = @Queue(),
          key={"error"},
          exchange = @Exchange(type = "direct",name="directs")
      )})
  public void receive2(String message){
    System.out.println("message2 = " + message);
  }
}
